from socket import *
import time
ip_port = ("localhost", 1234)
buffer_size=1024
tcp_clent = socket(AF_INET,SOCK_DGRAM)
print("发送消息。。。。。。")
while True:
    msg = input("请输入字符串：>>>").strip()
    if not msg:continue
    tcp_clent.sendto(msg.encode("utf-8"),ip_port)
    time.sleep(2)
    data=tcp_clent.recvfrom(buffer_size)
    print("server send message is :",data)
tcp_clent.close()